<template>
  <div class="manage_page fillcontain">
    <el-row style="height: 100%;">
      <el-col :span="4" style="min-width:200px;min-height: 100%; background-color: #324057;">
        <el-menu
          class="el-menu--dark"
          :default-active="defaultActive"
          style="min-height: 100%;width:100%;"
          background-color = "#324057"
          text-color="#bfcbd9"
          active-text-color="#20a0ff"
          unique-opened
          router
        >
          <el-menu-item index="Manage" class="sy">
            <i class="el-icon-menu"></i>首页
          </el-menu-item>
          <el-submenu class="el-submenu-title" index="2">
            <template slot="title">
              <i class="el-icon-document"></i>数据管理
            </template>
            <el-menu-item index="UserList">用户列表</el-menu-item>
            <el-menu-item index="ShopList">商家列表</el-menu-item>
            <el-menu-item index="FoodList">食品列表</el-menu-item>
            <el-menu-item index="OrderList">订单列表</el-menu-item>
            <el-menu-item index="AdminList">管理员列表</el-menu-item>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-plus"></i>添加数据
            </template>
            <el-menu-item index="AddShop">添加商铺</el-menu-item>
            <el-menu-item index="AddGoods">添加商品</el-menu-item>
          </el-submenu>
          <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-star-on"></i>图表
            </template>
            <el-menu-item index="Visitor">用户分布</el-menu-item>
            <!-- <el-menu-item index="newMember">用户数据</el-menu-item> -->
          </el-submenu>
          <el-submenu index="5">
            <template slot="title">
              <i class="el-icon-edit"></i>编辑
            </template>
            <!-- <el-menu-item index="uploadImg">上传图片</el-menu-item> -->
            <el-menu-item index="VueEdit">文本编辑</el-menu-item>
          </el-submenu>
          <el-submenu index="6">
            <template slot="title">
              <i class="el-icon-setting"></i>设置
            </template>
            <el-menu-item index="AdminSet">管理员设置</el-menu-item>
            <!-- <el-menu-item index="sendMessage">发送通知</el-menu-item> -->
          </el-submenu>
          <el-submenu index="7">
            <template slot="title">
              <i class="el-icon-warning"></i>说明
            </template>
            <el-menu-item index="Explain">说明</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-col>
      <el-col :span="20" style="height: 100%;overflow: auto;">
        <keep-alive>
          <router-view></router-view>
        </keep-alive>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "Home",
  computed: {
    defaultActive: function() {
      let routePath = this.$route.path
      if (routePath) {
        return routePath.replace("/", "")
      }
      return routePath
    }
  }
};
</script>
<style lang="less">
@import "../assets/styles/mixin.less";
@import "../assets/styles/Manage/index.less";
</style>